<?php


namespace app\validate;

use think\Validate;
class CarCheck extends Validate
{
    protected $rule = [
        'id' => 'require',
        'user_id' => 'require',
        'name'=>'require',
        'car_number'=>'require',
        'product_at'=>'require',
        'range'=>'require'
    ];

    protected $message = [
        'id.require' => '记录id不能为空',
        'user_id.require' => '用户id不能为空',
        'name'=>'请选择车型',
        'car_number'=>'请输入车牌号',
        'product_at'=>'请输入生产日期',
        'range'=>'请输入续航里程'
    ];

    protected $scene = [
        'car_index' => ['user_id'],
        'car_add' => ['user_id','name','car_number','product_at','range'],
        'car_save' => ['id','user_id','name','car_number','product_at','range'],
        'car_del' => ['id','user_id']
    ];
}